package com.example.juheweatherapi.controllers;

import com.example.juheweatherapi.services.ApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
public class WeatherController {

    @Autowired
    private ApiService apiServicel;

     @RequestMapping("getDataByCity")
    public String getDataByCity(HttpServletRequest request){
         String cityName=request.getParameter("cityName");
         return apiServicel.getWeatherByCity(cityName);
     }

}
